package com.zjitc;

import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Hello world!
 *
 */
public class App1 {

  public static void main(String[] args) {
    ApplicationContext applicationContext = new AnnotationConfigApplicationContext(
        DataSourceConfiguration2.class);
    DataSource ds = applicationContext.getBean(DataSource.class);
    try {
      Connection con = ds.getConnection();
      System.out.println(con);
    } catch (SQLException e) {
      e.printStackTrace();
    }
  }
}
